<form class="form-horizontal" id="form-add-swiper">

    <div class="form-group">
        <label class="control-label col-xs-2">奖名称<span style="color: #FF0000;">*</span></label>
        <div class="col-xs-9">
            <input type="text" class="form-control" name="title" placeholder="例如：一等奖" required />
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-2">商品名称<span style="color: #FF0000;">*</span></label>
        <div class="col-xs-9">
            <input type="text" class="form-control" name="goods_title" placeholder="商品名称" required />
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-2">中奖提示词<span style="color: #FF0000;">*</span></label>
        <div class="col-xs-9">
            <input type="text" class="form-control" name="price_title" placeholder="例如：恭喜抽中一等奖" required />
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-2">图片<span style="color: #FF0000;">*</span></label>
        <div class="col-xs-9">
            {include file="public/singleImageUploader" uploader-name="img_url" /}
            <div style="color: red">图片 推荐 宽:高=1:1</div>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-2">
            商品类型
            <span style="color: #FF0000;">*</span>
        </label>
        <div class="col-xs-9">
            <select id="type-selector" name="type" class="form-control" tabindex="-1" >
                {volist name="typeList" id="item"}
                <option value="{$item.type}">{$item.type_name}</option>
                {/volist}
            </select>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-2">商品数值</label>
        <div class="col-xs-9">
            <input type="number" min="1" step="1" class="form-control" name="num" placeholder="请填入商品数值" required />
            <span style="color: red"> 如商品类型 为 共享豆或SCB 填入1 则抽中后到账1共享豆, 如果为宠物 则此处代表宠物对应的推广收益数量</span>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-2">中奖比重</label>
        <div class="col-xs-9">
            <input type="number" min="0" step="1" class="form-control" name="gl" placeholder="中奖比重 商品中奖比重除以总比重即为中奖概率" required />
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-2">商品库存</label>
        <div class="col-xs-9">
            <input type="number" min="0" step="1" class="form-control" name="stock" placeholder="商品库存为0也不可抽中" required />
        </div>
    </div>


    <div class="form-group">
        <label class="control-label col-xs-2">是否显示</label>
        <div class="col-xs-9">
            <div class="btn-group" data-toggle="buttons">
                <label class="btn btn-default active">
                    <input type="radio" name="is_visible" id="visible_1" value="1" checked> 显示
                </label>
                <label class="btn btn-default">
                    <input type="radio" name="is_visible" id="visible_0" value="0" > 隐藏
                </label>
            </div>
        </div>
    </div>

    <div class="form-group">
        <div class="col-xs-offset-2 col-xs-3">
            <button type="submit" class="btn btn-success btn-block">确认添加</button>
        </div>
    </div>
</form>

<script src="__PUBLIC__/vendors/jquery.validation/jquery.validate.min.js"></script>
<script src="__PUBLIC__/vendors/jquery.validation/additional-methods.js"></script>
<script src="__PUBLIC__/vendors/jquery.validation/messages_zh.min.js"></script>
<script type="application/javascript">
    $(function () {
        $("#form-add-swiper").validate({
            messages:
                {

                },
            debug: true,
            submitHandler: function () {
                ajaxSubmit('form-add-swiper', true);
            }
        });

    })
</script>
<script src="__PUBLIC__/vendors/select2/js/select2.min.js"></script>
<script type="application/javascript">
    $(function () {
        $("#type-selector").select2({
            placeholder: "选择商品类型",
            allowClear: true
        });
    });
</script>